<template>
  <el-form
    ref="formInline"
    :inline="true"
    :model="formInline"
    label-width="80px"
    class="el-form--inline partner-form">
    <el-form-item
      label="伙伴类型"
      prop="partnerType">
      <el-select
        v-model="formInline.partnerType"
        placeholder="请选择">
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value"/>
      </el-select>
    </el-form-item>
    <el-form-item
      label="伙伴名称"
      prop="name">
      <el-input
        v-model="formInline.name"
        placeholder="请输入伙伴名称"/>
    </el-form-item>
    <el-form-item
      label="合作关系"
      prop="partnerShip">
      <el-select
        v-model="formInline.partnerShip"
        placeholder="请选择">
        <el-option
          v-for="item in partnerShipOptions"
          :key="item.value"
          :label="item.label"
          :value="item.value"/>
      </el-select>
    </el-form-item>
    <el-form-item
      label="业务区域"
      prop="area">
      <el-input
        v-model="formInline.area"
        placeholder="请输入业务区域"/>
    </el-form-item>
    <el-form-item
      label="是否培训"
      prop="train">
      <el-select
        v-model="formInline.train"
        placeholder="请选择">
        <el-option
          v-for="item in trainOptions"
          :key="item.value"
          :label="item.label"
          :value="item.value"/>
      </el-select>
    </el-form-item>
    <el-form-item
      label="是否背调"
      prop="backTune">
      <el-select
        v-model="formInline.backTune"
        placeholder="请选择">
        <el-option
          v-for="item in backTuneOptions"
          :key="item.value"
          :label="item.label"
          :value="item.value"/>
      </el-select>
    </el-form-item>
    <el-form-item
      label="负责人"
      prop="user">
      <el-input
        v-model="formInline.user"
        placeholder="请输入负责人"/>
    </el-form-item>
    <el-form-item
      label="产品线"
      prop="line">
      <el-input
        v-model="formInline.line"
        placeholder="请输入产品线"/>
    </el-form-item>
    <el-form-item
      label="创建时间"
      class="partnerDataPicker"
      prop="startTime">
      <el-date-picker
        class="e-input"
        v-model="formInline.startTime"
        type="date"
        placeholder="开始日期"/>
    </el-form-item>
    ~
    <el-form-item
      class="partnerDataPicker"
      prop="endTime">
      <el-date-picker
        class="e-input"
        v-model="formInline.endTime"
        type="date"
        placeholder="结束日期"/>
    </el-form-item>
    <el-form-item class="search-button-list">

      <el-button
        type="primary"
        @click="search">查询</el-button>
      <el-button
        type="default"
        @click="reset">重置</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  name: 'SearchForm',
  data () {
    return {
      formInline: {
        name: '',
        partnerType: '',
        partnerShip: '',
        area: '',
        train: '',
        backTune: '',
        user: '',
        line: '',
        startTime: '',
        endTime: ''
      },
      options: [{
        value: '注册证持有人',
        label: '注册证持有人'
      }, {
        value: '生产商',
        label: '生产商'
      }, {
        value: '经销商',
        label: '经销商'
      }, {
        value: '医疗机构',
        label: '医疗机构'
      }, {
        value: '医药公司',
        label: '医药公司'
      }, {
        value: '服务商',
        label: '服务商'
      }, {
        value: '配送商',
        label: '配送商'
      }, {
        value: '政府机构',
        label: '政府机构'
      }, {
        value: '银行',
        label: '银行'
      }, {
        value: '保险机构',
        label: '保险机构'
      }, {
        value: '其他',
        label: '其他'
      }],
      partnerShipOptions: [{
        value: '上游',
        label: '上游'
      }, {
        value: '下游',
        label: '下游'
      }, {
        value: '其他',
        label: '其他'
      }],
      trainOptions: [{
        value: '是',
        label: '是'
      }, {
        value: '否',
        label: '否'
      }],
      backTuneOptions: [{
        value: '是',
        label: '是'
      }, {
        value: '否',
        label: '否'
      }],
      value: ''
    }
  },
  methods: {
    search () {
      this.$emit('search')
    },
    reset () {
      this.$refs['formInline'].resetFields()
    }
  }
}
</script>

<style lang="less">

</style>
<style scoped lang="less">
.partner-form {
  .e-input {
    width: 142px;
  }
}

</style>
